package com.gitee.cirnochat.common.constant;


public interface RedisKey {

    //region token 登录凭证

    /**
     * Redis中存储refresh_token的key
     */
    String REFRESH_TOKEN_KEY = "cirno:chat:refresh_token::";
    /**
     * Redis中存储access_token的key
     */
    String ACCESS_TOKEN_KEY = "cirno:chat:access_token::";

    //endregion

    //region email 邮箱

    /**
     * 邮箱登录/注册验证码缓存键
     */
    String EMAIL_LOGIN_CAPTCHA_CACHE_KEY = "cirno:email:login:captcha::";

    /**
     * 通过邮箱进行密码重置
     */
    String EMAIL_RESET_PASS_CAPTCHA_CACHE_KEY = "cirno:email:reset:pass:captcha::";

    //endregion

    //region chat 聊天

    /**
     * 离线消息缓存
     */
    String CHAT_OFFLINE_MESSAGE = "cirno:chat:offline::";

    /**
     * 离线消息消费者
     */
    String CHAT_OFFLINE_MESSAGE_CONSUMED = "cirno:chat:offline:consume::";

    /**
     * 心跳消息消费者
     */
    String HEARTBEAT_MESSAGE_CONSUMED = "cirno:chat:heartbeat:consume::";

    /**
     * 用户的WebRTC通话状态 (1:请求中, 2:通话中)
     */
    String USER_CALLING_STATUS = "cirno:chat:user:calling::";

    //endregion

    //region user 用户相关

    /**
     * 用户权限缓存的 key 前缀
     */
    String USER_PERMISSION_CACHE_KEY = "cirno:chat:user:permission::";
    /**
     * 用户实体信息缓存的 key 前缀
     */
    String USER_ENTITY_CACHE_KEY = "cirno:chat:user:entity::";
    /**
     * 用户状态的 key 前缀
     */
    String USER_STATE_KEY = "cirno:chat:user:state::";

    /**
     * 用户上次在线的 key 前缀
     */
    String USER_LAST_ONLINE_KEY = "cirno:chat:user:last_online::";

    //endregion

    // region websocket 频道订阅

    /**
     * 用户是否订阅了聊天频道
     */
    String USER_CHAT_CHANNEL_SUBSCRIBE_STATE_KEY = "cirno:chat:user:subscribe:chat::";

    /**
     * 用户目前订阅的会话
     */
    String USER_SESSION_CHANNEL_SUBSCRIBE_STATE_KEY = "cirno:chat:user:subscribe:session::";

    /**
     * 用户是否订阅了WebRTC通话频道
     */
    String USER_SUBSCRIBE_CALLING_CHANNEL = "cirno:chat:user:subscribe:calling::";

    //endregion

    //region notification 推送相关

    /**
     * Expo推送token锁
     */
    String EXPO_PUSH_TOKEN_LOCK_KEY = "cirno:chat:expo_push_token_lock_key::";
    /**
     * 极光推送token锁
     */
    String JIGUANG_PUSH_TOKEN_LOCK_KEY = "cirno:chat:jiguang_push_token_lock_key::";

    //endregion

    //region file 文件

    /**
     * 根据MD5值锁文件
     */
    String FILE_UPLOAD_LOCK_KEY = "cirno:file:upload:lock::";

    //endregion

    //region other 其它

    /**
     * 二维码ID缓存键
     */
    String QR_CODE_ID_KEY = "cirno:chat:qrcode::";

    /**
     * 群组成员缓存键
     */
    String GROUP_MEMBERS_CACHE_KEY = "cirno:chat:group:members";

    /**
     * Redis缓存中兑换码状态的键
     */
    String REDEEM_CODE_STATE_CACHE_KEY = "cirno:chat:redeem_code_state::";

    //endregion
}
